// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.utils;

import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.context.ApplicationContextAware;

@Component
public class GetBeanUtils implements ApplicationContextAware
{
    public static ApplicationContext applicationContext;
    
    public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
        GetBeanUtils.applicationContext = applicationContext;
    }
    
    public static Object getBean(final String name) throws NoSuchBeanDefinitionException {
        return GetBeanUtils.applicationContext.getBean(name);
    }
    
    public static <T> T getBean(final Class<T> clazz) throws NoSuchBeanDefinitionException {
        return (T)GetBeanUtils.applicationContext.getBean((Class)clazz);
    }
    
    public static <T> T getBean(final String name, final Class<T> clazz) throws NoSuchBeanDefinitionException {
        return (T)GetBeanUtils.applicationContext.getBean(name, (Class)clazz);
    }
}
